package practice1.object;

public class Practice {
    public static void main(String[] args) {
        String path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";

        String[] arr = path.split("\\?");
        System.out.println(arr[0]);
        System.out.println(arr[1]);
        arr = arr[1].split("&");

        for (int i = 0; i < arr.length ; i++) {

                String[] data = arr[i].split("=");
                System.out.println("参数名是" + data[0] + "\t参数值" + data[1]);

        }

       /* for (int i = 0; i < arr.length; i++) {
             //String line = arr[i];
            String[] data = arr[i].split("=");
            System.out.println("参数名是" + data[0] + "参数值" + data[1]);
        }*/


    }
}
